<template>
  <el-container>
    <el-header>
      <Menu></Menu>
    </el-header>
    <el-main>
  <div style="width:100%">

    <el-container style="margin-right:10%;">
      <el-main style="height:1400px;margin-top:30px;margin-left:16%">
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick" style="width:700px;">
          <el-tab-pane label="问题" name="first">
            <div class="content">
              <table class="table table-hover" style="table-layout:fixed" width="100%">
                <tbody>
                  <tr v-for="item in data" :key="item.id" style="text-align:left;cursor:pointer"  @click="answer">
                    <td>
                      {{item.name}}
                      
                    </td>
                    <br>
                   
                    <td style="text-align:right;color:#808080;font-size:10px" >
                       <i class="el-icon-view"></i>
                      访问量：
                    </td>
                   
                   
                  </tr>
                </tbody>
              </table>
            </div>
          </el-tab-pane>
          <el-tab-pane label="竞赛" name="second">
            <div class="content2">
              <table class="table table-striped">
                <thead>
                  <tr>
                    <th>名称</th>
                    <th>级别</th>
                    <th>比赛时间</th>
                  </tr>
                </thead>
              </table>
            </div>
          </el-tab-pane>
          <el-tab-pane label="角色管理" name="third"></el-tab-pane>
          <el-tab-pane label="定时任务补偿" name="fourth"></el-tab-pane>
        </el-tabs>
        <el-pagination
          background
          layout="prev, pager, next"
          :total="1000"
          style="margin-top:30px"
        ></el-pagination>
      </el-main>
      <el-aside width="25%">
        <el-card class="box-card" shadow="always" style="margin-left:20px;text-align:left;margin-top:10px">
          <div slot="header" class="clearfix">
            <span style="font-weight:bold">最新资讯</span>
            <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
          </div>
          <div v-for="o in 4" :key="o" class="text item">{{'列表内容 ' + o }}</div>
        </el-card>
      </el-aside>
    </el-container>
  </div>
    </el-main>
  </el-container>
</template>

<script>
import Menu from '../components/Menu.vue'

export default {
  components:{
    Menu
  },
  data() {
    return {
      activeName: "first",
      data: [
        { id: "123123", name: "jameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeees" },
        { id: "dasdwe", name: "jack" }
      ]
    };
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    answer(){
      this.$router.push('/answersheet')
    }
  }
};
</script>

<style>
.content {
  margin-top: 10px;
  width: 700px;

  border-top: 5px lightblue solid;
}

.content2 {
  margin-top: 10px;
  width: 700px;
  border-top: 5px rgb(161, 233, 197) solid;
}
.el-tabs__item {
  font-size: 20px;
}

td{
  width: 80%;
   text-overflow:ellipsis; white-space:nowrap; overflow:hidden; 
}
</style> 